<meta title="新建管理员" width="800px"/>
<form class="form-horizontal"
      id="settingForm"
      s="form,valid" action="/api/admin/adminUser" s-valid="{notice: validNotice}"
      style="padding-top: 30px;" method="put">
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">账号：</label>
        <div class="col-sm-10">
            <input type="text" name="adminName" class="form-control"
                   s-valid-label="账号"
                   s-valid-error="require(),len(2,12)">
        </div>
    </div>
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">密码：</label>
        <div class="col-sm-10">
            <input type="password" name="adminPassword" class="form-control"
                   s-valid-label="密码"
                   s-valid-error="len(6,30)">
        </div>
    </div>
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">权限：</label>
        <div class="col-sm-10">
            <select s="select" id="province" name="roleId"
                    style="display: inline-block; width: 150px;"
                    s-build="S.get('/api/admin/menuAdminGroup')"
                    s-valid-error="require()"
                    class="form-control">
                <option value="">选择权限</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">状态：</label>

        <div class="col-sm-10">
            <label class="radio-inline"><input checked type="radio" name="isEffect" value="1"/>启用</label>
            <label class="radio-inline"><input type="radio" name="isEffect" value="0"/>冻结</label>
        </div>
    </div>
</form>
<script type="text/javascript">
    S.meta.btns = [
        {
            name: "保存",
            style: "btn btn-primary",
            click: function () {
                return S.S("#settingForm").submit().done(function (rs) {
                    S.close(true);
                    S.notice("新建管理员", "success");
                });
            }
        },
        {
            name: "关闭",
            style: "btn btn-default",
            click: function () {
                S.close();
            }
        }
    ];

    function validNotice(node, msg, level) {
        if (level == 'error') {
            S.notice(msg, 'danger');
        }
    }
</script>